package com.olive.lister;

import java.util.Date;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;

import com.olive.dto.NoticeDTO;
import com.olive.service.MessageRevceiver;

@EnableBinding(MessageRevceiver.class)
public class MessageListener {

    @StreamListener(MessageRevceiver.INPUT)
    public void input(Message<NoticeDTO> message) {
    	NoticeDTO noticeDTO = message.getPayload();
        System.out.println("消息接收：<" + noticeDTO.getMessage()  + "> 完成，时间：" + new Date());
    }
}

